﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MachineVision.Domain.Migrations
{
    public partial class AddCarNO : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "NO",
                table: "WarningInfos",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<int>(
                name: "VisionMissionId",
                table: "MissionHistoryInfos",
                type: "int",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddColumn<string>(
                name: "NO",
                table: "MissionHistoryInfos",
                type: "longtext",
                nullable: true)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.UpdateData(
                table: "MissionHistoryInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "EndTime", "StartTime", "VisionMissionId" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 37, 11, 608, DateTimeKind.Local).AddTicks(1894), null });

            migrationBuilder.UpdateData(
                table: "PatrolCars",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894));

            migrationBuilder.UpdateData(
                table: "PatrolGroups",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894));

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 4,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "WarningInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "Time" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "NO",
                table: "WarningInfos");

            migrationBuilder.DropColumn(
                name: "NO",
                table: "MissionHistoryInfos");

            migrationBuilder.AlterColumn<int>(
                name: "VisionMissionId",
                table: "MissionHistoryInfos",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.UpdateData(
                table: "MissionHistoryInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "EndTime", "StartTime", "VisionMissionId" },
                values: new object[] { new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 8, 25, 10, 3, 1, 13, DateTimeKind.Local).AddTicks(5755), 0 });

            migrationBuilder.UpdateData(
                table: "PatrolCars",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755));

            migrationBuilder.UpdateData(
                table: "PatrolGroups",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755));

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 4,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755) });

            migrationBuilder.UpdateData(
                table: "WarningInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "Time" },
                values: new object[] { new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755), new DateTime(2022, 8, 25, 10, 4, 1, 13, DateTimeKind.Local).AddTicks(5755) });
        }
    }
}
